dynamic trigger to inhibit save

Has anyone developed an approach to temporary inhibit saving a module.

Would be nice if there was a dynamic trigger or a work around that for the lack of a dynamic save trigger.
doors36677 - Tue Oct 06 08:53:09 EDT 2009

Re: dynamic trigger to inhibit save
SystemAdmin - Tue Oct 06 11:09:53 EDT 2009

Well, you have described a solution to some requirement, but what is the requirement? Why this is needed?

Re: dynamic trigger to inhibit save
llandale - Tue Oct 13 13:24:58 EDT 2009

You can have a post-open-module trigger that checks for Edit or Share, and downgrades to read. Its won't stop 'saving' but will stop changing.

Be sure to code in a bypass, such as letting the 'Administrator' go ahead and Edit the module, thus letting you remove the trigger.

  • Louie

Re: dynamic trigger to inhibit save
SystemAdmin - Fri Jan 15 07:39:04 EST 2010

Hi,

We use this method. The trigger is a pre save atribute level trigger

***********
if(confirm ("Deploy Trigger" nameTrig "?")){
t = trigger(nameTrig, module->sModName->object->all->attribute->all,
pre, save, 10, "#include <addins/Tool DXL/triggers/cmLockOutModule.inc>")

if( null t ) {
ack "Failed"
} else {
ack "Loaded"
}
}
****************

and this runs some code, the main part being

****************

if( AttrExists( m , attName ) )
{
cmGroup = m.attName ""
canChangeAttr = isInGroup (u, cmGroup)
if ( canChangeAttr )
{
set(trigPreConPass)
}else
{
set(trigPreConFail)
msgText = "Sorry " userName " but the " tAttrName " attribute is under CM. \nPlease raise a CR to change this object"
ack( msgText, time )
}
}
******************

the trigPreConFail will stop the object from saving.

Kevin Tarling